package ceha.application;

import ceha.util.BackupMysql;
import ceha.util.Mysql;

import ceha.util.SystemTrayCde;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Toolkit;
import java.beans.Beans;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JFileChooser;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;

public class CEHALogin extends javax.swing.JFrame {

    private boolean login;
    private boolean loginadmin;
    private boolean fixer;
    private int largeur;
    private int hauteur;
    private final CEHAAdmin adminparam;

    public CEHALogin() throws IOException, SQLException {

        //Tray icon
        new SystemTrayCde(this);
        initComponents();
        //test connection // attention apres initComponents
        new Mysql(this).Connect();

        try {
            UIManager.setLookAndFeel("WindowsLookAndFeel");
        } catch (InstantiationException e) {
        } catch (ClassNotFoundException e) {
        } catch (UnsupportedLookAndFeelException e) {
        } catch (IllegalAccessException e) {
        }
        adminparam = new CEHAAdmin(this);
        if (adminparam.getCheckAuto().isEnabled()) {
            pseudoField.setText(adminparam.getPseudoAuto().getText());
            passField.setText(adminparam.getPassAuto().getText());
        }
        if (!Beans.isDesignTime()) {
            entityManager.getTransaction().begin();
        }
//        int inset1, inset2;
//        if (is17pouces()) {
//            inset1 = 320;
//            inset2 = 250;
//            setBounds(inset1, inset2, 1280 - inset1 * 2, 1024 - inset2 * 2);
//        } else {
//            int bord = 300;
//            Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
//            largeur = screenSize.width - bord * 2;
//            hauteur = screenSize.height - bord * 2;
//            setBounds(bord, bord, largeur, hauteur);
//        }
        paramPanel.setEnabled(false);
        TabPanel.setEnabled(false);
        jPanel1.setEnabled(false);
        repvignette.setEnabled(false);
        actionPanel.setVisible(true);
        adminButton.setEnabled(false);
        creerficheButton.setEnabled(false);
        controleValideButton.setEnabled(false);
        consultPanel.setVisible(true);
        consultPanel.setLocation(5, 5);
        loginPanel.setVisible(true);
    }

    public boolean is17pouces() {
        return adminparam.getEcr17p().isEnabled();
    }

    public String getRepVignette() {
        return adminparam.getRepvignette().getText();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        entityManager = java.beans.Beans.isDesignTime() ? null : javax.persistence.Persistence.createEntityManagerFactory("BDDCEHAPU").createEntityManager();
        query = java.beans.Beans.isDesignTime() ? null : entityManager.createQuery("SELECT f FROM Fiche f");
        list = java.beans.Beans.isDesignTime() ? java.util.Collections.emptyList() : org.jdesktop.observablecollections.ObservableCollections.observableList(query.getResultList());
        loginPanel = new javax.swing.JPanel();
        passField = new javax.swing.JPasswordField();
        pseudoLabel = new javax.swing.JLabel();
        pseudoField = new javax.swing.JTextField();
        logoutButton = new javax.swing.JButton();
        passLabel = new javax.swing.JLabel();
        loginButton = new javax.swing.JButton();
        logoLabel = new javax.swing.JLabel();
        bienvenueLabel = new javax.swing.JLabel();
        consultPanel = new javax.swing.JPanel();
        consultButton = new javax.swing.JButton();
        actionPanel = new javax.swing.JPanel();
        creerficheButton = new javax.swing.JButton();
        adminButton = new javax.swing.JButton();
        controleValideButton = new javax.swing.JButton();
        paramPanel = new javax.swing.JPanel();
        TabPanel = new javax.swing.JTabbedPane();
        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        repvignette = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jLabel8 = new javax.swing.JLabel();
        MysqlField = new javax.swing.JTextField();
        jPanel3 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        droitsButton = new javax.swing.JButton();
        jPanel4 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        checkAuto = new javax.swing.JCheckBox();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        pseudoAuto = new javax.swing.JTextField();
        passAuto = new javax.swing.JPasswordField();
        jPanel5 = new javax.swing.JPanel();
        jLabel10 = new javax.swing.JLabel();
        dossiersave1 = new javax.swing.JTextField();
        parcourirButton = new javax.swing.JButton();
        jLabel9 = new javax.swing.JLabel();
        nomsave1 = new javax.swing.JTextField();
        lancerButton1 = new javax.swing.JButton();
        jPanel6 = new javax.swing.JPanel();
        ecr17p = new javax.swing.JCheckBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("BASE DE DONNEES  DU  CEHA");
        setAlwaysOnTop(true);
        setBackground(new java.awt.Color(255, 255, 255));
        setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        loginPanel.setBackground(new java.awt.Color(255, 255, 255));
        loginPanel.setBorder(javax.swing.BorderFactory.createEtchedBorder(new java.awt.Color(255, 255, 153), new java.awt.Color(102, 102, 102)));

        passField.setBackground(new java.awt.Color(255, 255, 204));
        passField.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
        passField.setToolTipText("laissez les champs vides pour une simple recherche");
        passField.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED, new java.awt.Color(51, 51, 255), new java.awt.Color(204, 255, 255), null, null));

        pseudoLabel.setBackground(new java.awt.Color(0, 0, 0));
        pseudoLabel.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
        pseudoLabel.setForeground(new java.awt.Color(255, 255, 255));
        pseudoLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        pseudoLabel.setText("Pseudo ");
        pseudoLabel.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        pseudoLabel.setOpaque(true);

        pseudoField.setBackground(new java.awt.Color(255, 255, 204));
        pseudoField.setFont(new java.awt.Font("Arial", 1, 14)); // NOI18N
        pseudoField.setToolTipText("");
        pseudoField.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED, new java.awt.Color(51, 102, 255), new java.awt.Color(204, 255, 255), null, null));

        logoutButton.setBackground(new java.awt.Color(255, 255, 255));
        logoutButton.setFont(new java.awt.Font("Times New Roman", 1, 14));
        logoutButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ceha/ressource/48px-System-log-out-2.svg.png"))); // NOI18N
        logoutButton.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(255, 0, 0), 5, true), "Sortir", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.TOP, new java.awt.Font("Trebuchet MS", 1, 18), new java.awt.Color(255, 0, 0))); // NOI18N
        logoutButton.setContentAreaFilled(false);
        logoutButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                logoutA(evt);
            }
        });

        passLabel.setBackground(new java.awt.Color(0, 0, 0));
        passLabel.setFont(new java.awt.Font("Times New Roman", 1, 18)); // NOI18N
        passLabel.setForeground(new java.awt.Color(255, 255, 255));
        passLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        passLabel.setText("Mot de passe");
        passLabel.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        passLabel.setOpaque(true);

        loginButton.setBackground(new java.awt.Color(255, 255, 204));
        loginButton.setFont(new java.awt.Font("Times New Roman", 1, 14)); // NOI18N
        loginButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ceha/ressource/petitecleflogin.jpg"))); // NOI18N
        loginButton.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(51, 204, 0), 5, true), "Entrer", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 1, 18), new java.awt.Color(0, 255, 0))); // NOI18N
        loginButton.setContentAreaFilled(false);
        loginButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                loginA(evt);
            }
        });

        logoLabel.setHorizontalAlignment(javax.swing.SwingConstants.TRAILING);
        logoLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ceha/ressource/moyenlogoCEHA.jpg"))); // NOI18N
        logoLabel.setVerticalAlignment(javax.swing.SwingConstants.BOTTOM);

        bienvenueLabel.setFont(new java.awt.Font("Palatino Linotype", 3, 18)); // NOI18N
        bienvenueLabel.setForeground(new java.awt.Color(255, 255, 255));
        bienvenueLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        bienvenueLabel.setText("Bienvenue au CEHA !");
        bienvenueLabel.setBorder(new org.jdesktop.swingx.border.DropShadowBorder());

        javax.swing.GroupLayout loginPanelLayout = new javax.swing.GroupLayout(loginPanel);
        loginPanel.setLayout(loginPanelLayout);
        loginPanelLayout.setHorizontalGroup(
            loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(loginPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(bienvenueLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, loginPanelLayout.createSequentialGroup()
                        .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(pseudoLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(passLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addComponent(logoutButton, javax.swing.GroupLayout.PREFERRED_SIZE, 79, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addGroup(loginPanelLayout.createSequentialGroup()
                                .addComponent(logoLabel)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(loginButton, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(passField)
                            .addComponent(pseudoField, javax.swing.GroupLayout.DEFAULT_SIZE, 217, Short.MAX_VALUE))))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        loginPanelLayout.setVerticalGroup(
            loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(loginPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(pseudoLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 26, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(pseudoField, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(passLabel)
                    .addComponent(passField, javax.swing.GroupLayout.DEFAULT_SIZE, 26, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(loginPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(logoutButton)
                    .addComponent(logoLabel)
                    .addComponent(loginButton))
                .addGap(18, 18, 18)
                .addComponent(bienvenueLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        consultPanel.setBackground(new java.awt.Color(0, 51, 102));
        consultPanel.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED, new java.awt.Color(204, 255, 255), new java.awt.Color(102, 153, 255), new java.awt.Color(204, 255, 255), new java.awt.Color(102, 153, 255)));

        consultButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ceha/ressource/icone_open_folder-8-98e04.png"))); // NOI18N
        consultButton.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 0, 0), 7), "Consulter les fiches", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Trebuchet MS", 3, 24), new java.awt.Color(255, 255, 255))); // NOI18N
        consultButton.setContentAreaFilled(false);
        consultButton.setDisabledIcon(new javax.swing.ImageIcon(getClass().getResource("/ceha/ressource/40px-Light_green_check.svg.png"))); // NOI18N
        consultButton.setFocusable(false);
        consultButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        consultButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
        consultButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                consultA(evt);
            }
        });

        javax.swing.GroupLayout consultPanelLayout = new javax.swing.GroupLayout(consultPanel);
        consultPanel.setLayout(consultPanelLayout);
        consultPanelLayout.setHorizontalGroup(
            consultPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(consultPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(consultButton, javax.swing.GroupLayout.DEFAULT_SIZE, 327, Short.MAX_VALUE)
                .addContainerGap())
        );
        consultPanelLayout.setVerticalGroup(
            consultPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(consultPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(consultButton, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)
                .addContainerGap())
        );

        actionPanel.setBackground(new java.awt.Color(255, 255, 255));
        actionPanel.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED, new java.awt.Color(255, 204, 0), new java.awt.Color(255, 255, 204), new java.awt.Color(102, 102, 102), new java.awt.Color(255, 255, 255)));
        actionPanel.setForeground(new java.awt.Color(255, 255, 255));

        creerficheButton.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        creerficheButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ceha/ressource/fiche.jpg"))); // NOI18N
        creerficheButton.setToolTipText("N'entrez rien pour une simple recherche dans la base");
        creerficheButton.setBorder(javax.swing.BorderFactory.createTitledBorder(new javax.swing.border.LineBorder(new java.awt.Color(51, 102, 0), 5, true), "Créer des fiches", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Times New Roman", 1, 18), new java.awt.Color(0, 0, 0))); // NOI18N
        creerficheButton.setContentAreaFilled(false);
        creerficheButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                creerficheA(evt);
            }
        });

        adminButton.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N
        adminButton.setText("Administrer");
        adminButton.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(153, 0, 0), 5, true));
        adminButton.setContentAreaFilled(false);
        adminButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                adminA(evt);
            }
        });

        controleValideButton.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N
        controleValideButton.setText("Contrôler et Valider");
        controleValideButton.setBorder(new javax.swing.border.LineBorder(new java.awt.Color(0, 0, 0), 5, true));
        controleValideButton.setContentAreaFilled(false);
        controleValideButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                controleValideA(evt);
            }
        });

        javax.swing.GroupLayout actionPanelLayout = new javax.swing.GroupLayout(actionPanel);
        actionPanel.setLayout(actionPanelLayout);
        actionPanelLayout.setHorizontalGroup(
            actionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(actionPanelLayout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addGroup(actionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(creerficheButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, actionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(controleValideButton, javax.swing.GroupLayout.DEFAULT_SIZE, 191, Short.MAX_VALUE)
                        .addComponent(adminButton)))
                .addContainerGap(108, Short.MAX_VALUE))
        );
        actionPanelLayout.setVerticalGroup(
            actionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(actionPanelLayout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(creerficheButton, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(adminButton)
                .addGap(18, 18, 18)
                .addComponent(controleValideButton)
                .addContainerGap(14, Short.MAX_VALUE))
        );

        org.jdesktop.swingx.border.DropShadowBorder dropShadowBorder1 = new org.jdesktop.swingx.border.DropShadowBorder();
        dropShadowBorder1.setShadowColor(new java.awt.Color(255, 255, 204));
        paramPanel.setBorder(dropShadowBorder1);
        paramPanel.setFont(new java.awt.Font("Tahoma", 1, 11));

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel1.setForeground(new java.awt.Color(153, 0, 0));
        jLabel1.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel1.setText("Répertoire des vignettes");

        repvignette.setBackground(new java.awt.Color(255, 255, 204));
        repvignette.setFont(new java.awt.Font("Tahoma", 1, 14));
        repvignette.setText("C:\\Documents and Settings\\Gilles\\ImageCeha");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(repvignette, javax.swing.GroupLayout.PREFERRED_SIZE, 426, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel1))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(jLabel1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(repvignette, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(104, Short.MAX_VALUE))
        );

        TabPanel.addTab("Répertoires", jPanel1);

        jLabel8.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel8.setForeground(new java.awt.Color(153, 0, 0));
        jLabel8.setText("Gestionnaire serveur MySql");

        MysqlField.setBackground(new java.awt.Color(255, 255, 204));
        MysqlField.setFont(new java.awt.Font("Tahoma", 1, 14));
        MysqlField.setText("C:\\\\wamp\\\\wampmanager.exe");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel8)
                    .addComponent(MysqlField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(40, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel8)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(MysqlField, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(107, Short.MAX_VALUE))
        );

        TabPanel.addTab("MySql", jPanel2);

        jLabel2.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel2.setForeground(new java.awt.Color(153, 0, 0));
        jLabel2.setText("Droits des membres");

        droitsButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/ceha/ressource/gestion-droits.gif"))); // NOI18N
        droitsButton.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        droitsButton.setContentAreaFilled(false);
        droitsButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                droitsButton(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addGap(10, 10, 10)
                        .addComponent(droitsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 105, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())
                    .addGroup(jPanel3Layout.createSequentialGroup()
                        .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addGap(234, 234, 234))))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel2)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(droitsButton, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(45, Short.MAX_VALUE))
        );

        TabPanel.addTab("Droits", jPanel3);

        jLabel5.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel5.setForeground(new java.awt.Color(153, 0, 0));
        jLabel5.setText("Login automatique");

        checkAuto.setFont(new java.awt.Font("Tahoma", 1, 11));
        checkAuto.setSelected(true);
        checkAuto.setText("activer");

        jLabel6.setBackground(new java.awt.Color(0, 0, 0));
        jLabel6.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel6.setForeground(new java.awt.Color(255, 255, 255));
        jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel6.setText("Pseudo ");
        jLabel6.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jLabel6.setOpaque(true);

        jLabel7.setBackground(new java.awt.Color(0, 0, 0));
        jLabel7.setFont(new java.awt.Font("Tahoma", 1, 14));
        jLabel7.setForeground(new java.awt.Color(255, 255, 255));
        jLabel7.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabel7.setText("Mot de passe");
        jLabel7.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jLabel7.setOpaque(true);

        pseudoAuto.setBackground(new java.awt.Color(255, 255, 204));
        pseudoAuto.setFont(new java.awt.Font("Arial", 1, 12));
        pseudoAuto.setText("ceha");
        pseudoAuto.setToolTipText("");
        pseudoAuto.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED, new java.awt.Color(51, 102, 255), new java.awt.Color(204, 255, 255), null, null));

        passAuto.setBackground(new java.awt.Color(255, 255, 204));
        passAuto.setFont(new java.awt.Font("Arial", 1, 12));
        passAuto.setText("ceha");
        passAuto.setToolTipText("laissez les champs vides pour une simple recherche");
        passAuto.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.LOWERED, new java.awt.Color(51, 51, 255), new java.awt.Color(204, 255, 255), null, null));

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel4Layout.createSequentialGroup()
                        .addComponent(checkAuto)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel4Layout.createSequentialGroup()
                                .addGap(10, 10, 10)
                                .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, 120, Short.MAX_VALUE))
                            .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 130, Short.MAX_VALUE))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(passAuto, javax.swing.GroupLayout.DEFAULT_SIZE, 42, Short.MAX_VALUE)
                    .addComponent(pseudoAuto, javax.swing.GroupLayout.DEFAULT_SIZE, 42, Short.MAX_VALUE))
                .addGap(232, 232, 232))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(checkAuto)
                    .addComponent(jLabel6)
                    .addComponent(pseudoAuto, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(6, 6, 6)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7, javax.swing.GroupLayout.DEFAULT_SIZE, 21, Short.MAX_VALUE)
                    .addComponent(passAuto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        TabPanel.addTab("Login auto", jPanel4);

        jLabel10.setFont(new java.awt.Font("Times New Roman", 1, 14));
        jLabel10.setForeground(new java.awt.Color(153, 0, 0));
        jLabel10.setText("Dossier de souvegarde (éventuellement externe)");

        dossiersave1.setFont(new java.awt.Font("Times New Roman", 1, 14));

        parcourirButton.setFont(new java.awt.Font("Times New Roman", 1, 14));
        parcourirButton.setText("Choisir");
        parcourirButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                parcourirButtonchoixRepA(evt);
            }
        });

        jLabel9.setFont(new java.awt.Font("Times New Roman", 1, 14));
        jLabel9.setForeground(new java.awt.Color(153, 0, 0));
        jLabel9.setText("Nom de la sauvegarde");

        nomsave1.setFont(new java.awt.Font("Times New Roman", 1, 14));

        lancerButton1.setBackground(new java.awt.Color(255, 255, 255));
        lancerButton1.setFont(new java.awt.Font("Arial", 1, 12));
        lancerButton1.setForeground(new java.awt.Color(153, 0, 51));
        lancerButton1.setText("Lancer la sauvegarde");
        lancerButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                lancerButton1backupButton(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel10)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(dossiersave1, javax.swing.GroupLayout.PREFERRED_SIZE, 196, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(parcourirButton, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(lancerButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 180, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(nomsave1, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel9))
                .addGap(18, 18, 18))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addComponent(jLabel10)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(dossiersave1, javax.swing.GroupLayout.PREFERRED_SIZE, 21, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(parcourirButton, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jLabel9)
                .addGap(13, 13, 13)
                .addComponent(nomsave1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(lancerButton1)
                .addContainerGap(21, Short.MAX_VALUE))
        );

        TabPanel.addTab("BackUp", jPanel5);

        ecr17p.setBackground(new java.awt.Color(255, 255, 255));
        ecr17p.setFont(new java.awt.Font("Arial", 1, 12));
        ecr17p.setForeground(new java.awt.Color(153, 0, 51));
        ecr17p.setSelected(true);
        ecr17p.setText("écran 17 pouces");

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGap(15, 15, 15)
                .addComponent(ecr17p)
                .addContainerGap(140, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(ecr17p)
                .addContainerGap(137, Short.MAX_VALUE))
        );

        TabPanel.addTab("Ecran", jPanel6);

        javax.swing.GroupLayout paramPanelLayout = new javax.swing.GroupLayout(paramPanel);
        paramPanel.setLayout(paramPanelLayout);
        paramPanelLayout.setHorizontalGroup(
            paramPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, paramPanelLayout.createSequentialGroup()
                .addComponent(TabPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 281, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(36, Short.MAX_VALUE))
        );
        paramPanelLayout.setVerticalGroup(
            paramPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(paramPanelLayout.createSequentialGroup()
                .addComponent(TabPanel, javax.swing.GroupLayout.PREFERRED_SIZE, 211, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(consultPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(loginPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(actionPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(paramPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(consultPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(actionPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(loginPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(paramPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );

        java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
        setBounds((screenSize.width-709)/2, (screenSize.height-505)/2, 709, 505);
    }// </editor-fold>//GEN-END:initComponents

    private void consultA(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_consultA
        //Bureau consulatations
        new CEHAFicheConsultation(this).setVisible(true);
    }//GEN-LAST:event_consultA

    private void adminA(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_adminA
        if (loginadmin) {
            adminButton.setEnabled(true);
            paramPanel.setEnabled(true);
            TabPanel.setEnabled(true);
            jPanel1.setEnabled(true);
            repvignette.setEnabled(true);
        }
}//GEN-LAST:event_adminA

    private void creerficheA(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_creerficheA
        //Bureau création des fiches et administration
        new CEHAFicheCreation(this).setVisible(true);
    }//GEN-LAST:event_creerficheA

    private void controleValideA(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_controleValideA
        //        if (login) {
        //            JFrame frame = new JFrame("BDD CEHA Formulaire");
        //            CreationMasterDetailForm master = new CreationMasterDetailForm(this);
        //            master.getCommandes().setVisible(true);
        //            master.add(master.getCommandes());
        //            master.getAdminpanel().setVisible(flagadmin);
        //            master.getFormulaire().setVisible(true);
        //            frame.setContentPane(master);
        //            frame.pack();
        //            frame.setVisible(true);
        //
        //        } else {
        //            this.message = "Login nécessaire !";
        //            new OkDialog(this, true).setVisible(true);
        //        }
}//GEN-LAST:event_controleValideA

    private void loginA(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_loginA
        String nom = pseudoField.getText();
        String mot = passField.getText();
        Connection conn = null;
        try {
            conn = new Mysql(this).Connect();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
        Statement stmt;
        ResultSet res = null;
        List<String> Lpseudo = new ArrayList<String>();
        List<String> Lpass = new ArrayList<String>();
        //obsolète :        List<String> Lrole = new ArrayList<String>();
        List<Boolean> Lconsult = new ArrayList<Boolean>();
        List<Boolean> Lindex = new ArrayList<Boolean>();
        List<Boolean> Lvalid = new ArrayList<Boolean>();
        List<Boolean> Ladmin = new ArrayList<Boolean>();
        try {
            stmt = conn.createStatement();
            res = stmt.executeQuery("SELECT * FROM membre");
            while (res.next()) {
                Lpseudo.add(res.getString("pseudo"));
                Lpass.add(res.getString("pass"));
                //obsolete            //Lrole.add(res.getString("role"));
                Lconsult.add(res.getBoolean("consult"));
                Lindex.add(res.getBoolean("indexation"));
                Lvalid.add(res.getBoolean("validation"));
                Ladmin.add(res.getBoolean("administ"));
            }
            res.close();
            stmt.close();
            conn.close();

        } catch (SQLException e) {
            e.printStackTrace();
        }
        int no = 0;
        while (no < Lpseudo.size()) {
            if ((Lpseudo.get(no).equals(nom)) && (Lpass.get(no).equals(mot))) {
                if ((Lconsult.get(no)) && (Lvalid.get(no)) && (Lindex.get(no))) {
                    pseudoField.setBackground(Color.green);
                    passField.setBackground(Color.green);
                    login = true; // login "normal"
                    bienvenueLabel.setForeground(Color.BLACK);
                    if (Ladmin.get(no)) {
                        // login admin
                        loginadmin = true;

                    } else {
                        adminButton.setEnabled(false);
                    }
                    actionPanel.setVisible(true);
                    actionPanel.setLocation(130, 15);
                }
                break;
            } else {
                no++;
            }
            login = false; //pas de login
            pseudoField.setBackground(Color.red);
            passField.setBackground(Color.red);
        }
}//GEN-LAST:event_loginA

    private void logoutA(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_logoutA
        login = false;
        pseudoField.setText("");
        passField.setText("");
        pseudoField.setBackground(new Color(255, 255, 204));
        passField.setBackground(new Color(255, 255, 204));
        actionPanel.setVisible(false);
        //        actionJInternalFrame.getCreationFichesWin().dispose();
}//GEN-LAST:event_logoutA

    private void droitsButton(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_droitsButton
        //        droitsUtilisateursJInternalFrame.setVisible(true);
}//GEN-LAST:event_droitsButton

    private void lancerButton1backupButton(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_lancerButton1backupButton
        if (!nomsave1.getText().equals("")) {
            try {

                new BackupMysql(dossiersave1.getText() + nomsave1.getText() + ".zip");
            } catch (FileNotFoundException ex) {
                ex.printStackTrace();
            } catch (IOException ex) {
                ex.printStackTrace();
            } catch (Exception ex) {
                ex.printStackTrace();
            }

        }
}//GEN-LAST:event_lancerButton1backupButton

    private void parcourirButtonchoixRepA(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_parcourirButtonchoixRepA
        JFileChooser chooser = new JFileChooser();
        chooser.setCurrentDirectory(new java.io.File("."));
        chooser.setDialogTitle("choosertitle");
        chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        chooser.setAcceptAllFileFilterUsed(false);
        if (chooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION) {
            dossiersave1.setText(chooser.getCurrentDirectory().getAbsolutePath() + "\\");
        }
        //            System.out.println("getCurrentDirectory(): " + chooser.getCurrentDirectory());
        //            System.out.println("getSelectedFile() : " + chooser.getSelectedFile());
}//GEN-LAST:event_parcourirButtonchoixRepA

    public static void main(String args[]) {
        javax.swing.SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                CEHALogin main = null;
                try {
                    main = new CEHALogin();
                } catch (IOException ex) {
                    ex.printStackTrace();
                } catch (SQLException ex) {
                    ex.printStackTrace();
                }
//                main.setSize(600, 300);
                main.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField MysqlField;
    private javax.swing.JTabbedPane TabPanel;
    private javax.swing.JPanel actionPanel;
    private javax.swing.JButton adminButton;
    private javax.swing.JLabel bienvenueLabel;
    private javax.swing.JCheckBox checkAuto;
    private javax.swing.JButton consultButton;
    private javax.swing.JPanel consultPanel;
    private javax.swing.JButton controleValideButton;
    private javax.swing.JButton creerficheButton;
    private javax.swing.JTextField dossiersave1;
    private javax.swing.JButton droitsButton;
    private javax.swing.JCheckBox ecr17p;
    private javax.persistence.EntityManager entityManager;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JButton lancerButton1;
    private java.util.List<ceha.Fiche> list;
    private javax.swing.JButton loginButton;
    private javax.swing.JPanel loginPanel;
    private javax.swing.JLabel logoLabel;
    private javax.swing.JButton logoutButton;
    private javax.swing.JTextField nomsave1;
    private javax.swing.JPanel paramPanel;
    private javax.swing.JButton parcourirButton;
    private javax.swing.JPasswordField passAuto;
    private javax.swing.JPasswordField passField;
    private javax.swing.JLabel passLabel;
    private javax.swing.JTextField pseudoAuto;
    private javax.swing.JTextField pseudoField;
    private javax.swing.JLabel pseudoLabel;
    private javax.persistence.Query query;
    private javax.swing.JTextField repvignette;
    // End of variables declaration//GEN-END:variables
}
